// e22
names = new File('c:/dev/projecteuler/names.txt').readLines().flatten()*.split(/","/).flatten()*.replaceAll(/\W/,'').sort()
int val(ch) { (int) ch - (int) 'A' + 1 }
BigInteger nameval(name) { name.inject(0 as BigInteger) { sum, ch -> sum += val(ch) } }
BigInteger total = 0
names.eachWithIndex { name, i -> total += (i + 1) * nameval(name) }
println "==> $total"

